package com.service.NeuralNetworks;

import com.entity.Jarvis.JarvisNeuralNetworks;
import com.entity.NeuralNetworks.NeuralNetworks;
import com.entity.NeuralNetworks.Neurons;

import java.math.BigInteger;

/**
 * Created by wlc on 2018/5/30.
 */
public class NNModelConstruction extends JarvisNeuralNetworks{
    public static String NeuralNetworksModel(){
        int NeuralNetworksNum = NeuralNetworksCollection.size();
        String name = "NeuralNetworks" + NeuralNetworksNum;

        NeuralNetworksCollection.put(name,new NeuralNetworks());
        return name;
    }

    public static String NeuronsModel(String NeuralNetworksName,String neuronsId){
        NeuralNetworks neuralNetworks = NeuralNetworksCollection.get(NeuralNetworksName);
        Neurons neurons = new Neurons();
        neurons.setId(new BigInteger(neuronsId));
        neuralNetworks.setNeuronCollection(neurons.getId(),neurons);

        NeuralNetworksCollection.put(NeuralNetworksName,neuralNetworks);
        return "sucess";
    }

    public static String SynapseModel(String NeuralNetworksName,String synapseId){
        NeuralNetworks neuralNetworks = NeuralNetworksCollection.get(NeuralNetworksName);
        neuralNetworks.addSynapse(synapseId);

        NeuralNetworksCollection.put(NeuralNetworksName,neuralNetworks);
        return "sucess";
    }
}
